package com.bvgol.examples.netty.http;/**
 * @Classname HttpServerInitalizer
 * @Description TODO
 * @Date 2021/7/9 18:19
 * @Created by GUOCHEN
 */

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpServerCodec;

/**
 * @program: my-spring-completely
 * @description:
 * @author: GUOCHEN
 * @create: 2021/07/09 18:19
 */
public class HttpServerInitalizer extends ChannelInitializer<SocketChannel> {


    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline();
        pipeline.addLast("MYHttpServerCodec",new HttpServerCodec());
        pipeline.addLast("MYHttpServerHandler",new HttpServerHandler());

    }
}
